package com.app.controller;

import com.app.service.CountNumberService;
import com.app.service.MentorInfoService;
import com.app.util.Result;
import com.app.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 统计数量
 */
@Slf4j
@RestController
@RequestMapping("/jiuquan/count")
public class CountNumberController {
    //统计
    @Autowired
    private CountNumberService countNumberService;

    @Autowired
    private MentorInfoService mentorInfoService;

    //统计数量
    @GetMapping("/getCountAll")
    public Result<Object> getCountAll() {
        CountVo countAll = countNumberService.getCountAll();
        return Result.success(countAll);
    }

    //技能培训报名人数统计 7个城市统计
    @GetMapping("/getTrainPeopleCount")
    public Result<Object> getTrainPeopleCount() {
        XyVo countAll = countNumberService.getTrainPeopleCount();
        return Result.success(countAll);
    }

    //统计最近15天访问人数
    @GetMapping("/getNear15DayCount")
    public Result<Object> getNear15DayCount() {
        XyVo near15DayCount = countNumberService.getNear15DayCount();
        return Result.success(near15DayCount);
    }

    //统计各城市16-24问卷调查
    @GetMapping("/getInvestigateCount")
    public Result<Object> getInvestigateCount() {
        XyVo investigateCount = countNumberService.getInvestigateCount();
        return Result.success(investigateCount);
    }

    //问卷调查情况分析
    @GetMapping("/getInvestigateAnalysis")
    public Result<Object> getInvestigateAnalysis() {
        List<ValueAndNameVo> investigateAnalysis = countNumberService.getInvestigateAnalysis();
        return Result.success(investigateAnalysis);
    }

    //场地/导师 好评中评差评评价统计
    @GetMapping("/getCommentTypeCount")
    public Result<Object> getCommentTypeCount(Integer type) {
        List<ValueAndNameVo> commentType = countNumberService.getCommentTypeCount(type);
        return Result.success(commentType);
    }


    //贷款类型人数分析
    @GetMapping("/getLoanTypeAnalysis")
    public Result<Object> getLoanTypeAnalysis() {
        List<ValueAndNameVo> loanTypeAnalysis = countNumberService.getLoanTypeAnalysis();
        return Result.success(loanTypeAnalysis);
    }

    //创业困难原因分析
    @GetMapping("/getDifficultyAnalysis")
    public Result<Object> getDifficultyAnalysis() {
        List<ValueAndNameVo> difficultyAnalysis = countNumberService.getDifficultyAnalysis();
        return Result.success(difficultyAnalysis);
    }

    //创业场地申请次数
    @GetMapping("/getSiteApplyForCount")
    public Result<Object> getSiteApplyForCount() {
        XyVo siteApplyForCount = countNumberService.getSiteApplyForCount();
        return Result.success(siteApplyForCount);
    }

    //培训情况分析
    @GetMapping("/getTrainSituation")
    public Result<Object> getTrainSituation(Integer type) {
        XyVo trainSituation = countNumberService.getTrainSituation(type);
        return Result.success(trainSituation);
    }

    //创业导师情况分析
    @GetMapping("/getMentorSituationAnalysis")
    public Result<Object> getMentorSituationAnalysis() {
        List<ValueAndNameVo> mentorSituation = countNumberService.getMentorSituationAnalysis();
        return Result.success(mentorSituation);
    }


    //获取各地区场地数量
    @GetMapping("/getAreaIncubatorsCount")
    public Result<Object> getAreaIncubatorsCount() {
        List<AreaVo> areaIncubatorsCount = countNumberService.getAreaIncubatorsCount();
        return Result.success(areaIncubatorsCount);
    }

}
